﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Templates/Blue/Blue.Master" AutoEventWireup="true"
    CodeBehind="Contacts.aspx.cs" Inherits="WebApp.Contacts" %>

<asp:Content ID="Content1" ContentPlaceHolderID="_ctlContentMainHead" runat="server">
    <style>
        .x-div
        {
            font-size: 1.1em;
            line-height: 1.3em;
        }
        
        .cwt-x-mask
        {
            position: absolute;
            left: 0;
            top: 0;
            width:100%;
            height:100%;
            z-index: 9999;
            display: block;
        }
        
        input[type="text"], input[type="button"], button
        {
            padding:5px !important;
        }
    </style>
    <script>
        function submitContacts() {
            var username = $('customer_username').val();
            var telephone = $('customer_telephone').val();
            var email = $('customer_email').val();
            var address = $('customer_address').val();
            var verifycode = $('verify_code').val();
            var paramData = { username: username, telephone: telephone, email: email, address: address, verifycode: verifycode };
            $.ajax({
                url: './_actions/SubmitContact.ashx',
                type: 'post',
                dataType: 'json',
                data: paramData,
                beforeSend: function (XMLHttpRequest) { $('#mask').show(); },
                complete: function (XMLHttpRequest, textStatus) { $('#mask').hide(); },
                success: function (data, textStatus) {
                    alert(data.message);
                    window.location.reload();;
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) { alert(textStatus); }
            });
        }

        $(document).ready(function () {
            $('#mask').hide();
        });

        function refreshVerifyCode() {
            $('#img_verifycode').attr("src", "_Actions/Verifycode.ashx?t" + new Date().getTime());
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="_ctlContentMainMenu" runat="server">
    <ul>
        <li><a href="index.aspx">首页</a></li>
        <li><a href="#">关于我们</a></li>
        <li><a href="Course.aspx">课程简介</a></li>
        <li><a href="Knowledge.aspx">相关专业知识</a></li>
        <li><a href="FAQ.aspx">常见问题</a></li>
        <li class="current"><a href="#">联系我们</a></li>
    </ul>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="_ctlContentMainBody" runat="server">
    <div class="container">
        <div class="inside">
            <div class="wrapper indent">
                <h2>
                    联系我们</h2>
                <div style="width: 100%;">
                        电话:
                    <span class="x-div" id="_ctlTxtTelephone" runat="server">
                        000</span>
                </div>
                <div style="width: 100%;">
                        邮箱:
                    <span class="x-div" id="_ctlTxtEmail" runat="server">
                        000</span>
                </div>
                <div style="width: 100%;">
                        地址:
                    <span class="x-div" id="_ctlTxtAddress" runat="server">
                        000</span>
                </div>
                <div style="width: 100%;">
                        邮编:
                    <span class="x-div" id="_ctlTxtPostCode" runat="server">
                        000</span>
                </div>
                <br />
                <h2>
                    留下您的联系方式</h2>
                    <div>
                <p>
                    姓名:</p>
                <p>
                    <input id="customer_username" type="text" style="width: 300px;" />
                </p>
                <p>
                    电话:</p>
                <p>
                    <input id="customer_telephone" type="text" style="width: 300px;" />
                </p>
                <p>
                    邮箱</p>
                <p>
                    <input id="customer_email" type="text" style="width: 300px;" />
                </p>
                <p>
                    留言</p>
                <p>
                    <textarea id="customer_message" style="width: 300px; height:150px;"></textarea>
                </p>
                <p>
                    验证码
                </p>
                <p>
                    <input id="verify_code" type="text" style="width: 150px;" />
                    <img id="img_verifycode" src="_Actions/Verifycode.ashx" width="126px" type="text" height="32px" />
                    <a href="javascript:refreshVerifyCode();">看不清</a>
                </p>
                <p>
                    <button type="button" onclick="submitContacts();">
                        提交</button>
                </p>
    <div id="mask" class="cwt-x-mask">
        <h1 style=" width:200px; height:50px; margin:0 auto; vertical-align:center;">
            加载中等待...</h1>
    </div>
                    </div>
            </div>
        </div>
    </div>
</asp:Content>
